<template>
    <div>
        <!-- 详情弹出框 -->
        <el-dialog v-model="dialogFormVisible" title="Shipping address">
            <el-form :model="dialogData" label-width="100px">
                <el-form-item label="医务账号" prop="account">
                    <el-input v-model="dialogData.data.account" />
                </el-form-item>
                <el-form-item label="权限" prop="purvew">
                    <el-input v-model="dialogData.data.purview" />
                </el-form-item>
                <el-form-item label="账号密码" prop="password">
                    <el-input v-model="dialogData.data.password" />
                </el-form-item>
                <el-form-item label="身份证号" prop="idcard">
                    <el-input v-model="dialogData.data.idcard" />
                </el-form-item>
                <el-form-item label="手机号" prop="phone">
                    <el-input v-model="dialogData.data.phone" />
                </el-form-item>
                <el-form-item label="性别" prop="sex">
                    <el-input v-model="dialogData.data.sex" />
                </el-form-item>
                <el-form-item prop="headurl">
                    <img :src="dialogData.data.headurl" alt="" class="imgggg">
                </el-form-item>
            </el-form>
            <template #footer>
                <span class="dialog-footer">
                    <el-button type="primary" @click="dialogFormVisible = false">
                        确定
                    </el-button>
                </span>
            </template>
        </el-dialog>

        
    </div>
</template>

<script setup lang="ts">
import {ref,reactive, watchEffect} from 'vue'
import { usersDel, usersEdit, usersGetbyid, usersList, usersSearch } from '@/API/user.api';
const props=defineProps({
    data:{
        type:Object,
        defalut:()=>{}
    }
})


//*详情弹出框 */
const dialogFormVisible = ref(false)
// 详情弹出框数据
const dialogData = reactive({
    data: {
        account: '',
        password: '',
        sex: '',
        idcard: '',
        purview: '',
        phone: '',
        headurl: ''
    }
})
// 根据账号id获取账号详情
async function idData() {
    dialogFormVisible.value = true
    let res = await usersGetbyid({ id: props.data.id})
    let data = res.data.data[0]
    console.log(res.data.data[0]);
    // 给详情弹出框数据赋值
    dialogData.data = data
    // 给编辑弹出框数据赋值
    // editData.data = data
}


watchEffect(()=>{
    idData()
})





</script>

<style scoped lang="scss">
// 弹出框照片
.imgggg {
    width: 160px;
    height: 160px;
}
</style>